<template>
  <div>
    <!-- 头部 -->
    <Header></Header>
    <div class="container">
      <!-- 头部标题 -->
      <div class="header">
        <h1 class="title"><i class="el-icon-position"></i>关于我们</h1>
      </div>
      <!-- 内容部分 -->
      <div class="content">
        <ul>
          <li v-for="item in pageList" :key="item.id">
            <div class="content">
              <h2>{{ item.title }}</h2>
              <p v-html="item.content"></p>
            </div>
          </li>
        </ul>
      </div>
    </div>

    <!-- 尾部 -->
    <Footer></Footer>
  </div>
</template>

<script>
import Header from "@/components/Header.vue";
import Footer from "@/components/Footer.vue";
import { getPageList } from "@/api/page.js";
export default {
  components: { Header, Footer },
  data() {
    return {
      pageList: [],
    };
  },
  created() {
    this.getPageList();
  },
  methods: {
    async getPageList() {
      const res = await getPageList();
      this.pageList = res.data;
      console.log(" this.pageList: ", this.pageList);
    },
  },
};
</script>

<style lang="less" scoped>
.container {
  padding: 0 30px 30px 30px;
  width: 1000px;
  margin: 0 auto;
  .header {
    .title {
      font-size: 18px;
      color: orange;
      i {
        font-size: 20px;
        // color: orange;
        margin-right: 5px;
      }
    }
  }
  .content {
    padding: 10px;
    li {
      list-style: none;
      width: 100%;
      margin-right: 50px;
      height: 200px;
      display: flex;
      margin-bottom: 20px;
      border: 1px solid #ccc;
      overflow: auto;
      border-radius: 30px;
      .content {
        // text-align: center;
        flex: 1;
        h2{
            text-align: center;
            margin-bottom: 10px;
        }
        p{
            text-indent: 2em;
        }
      }
    }
  }
}
</style>